﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YogaDictionary.Model
{
    public class WordComparer : IComparer<Word>
    {
        public int Compare(Word x, Word y)
        {
            var xv = x.Value;
            var yv = y.Value;
            if (xv.First() > 128)
                xv = "__" + xv;
            if (yv.First() > 128)
                yv = "__" + yv;
            return string.Compare(xv, yv, ignoreCase: true, culture: new CultureInfo("ru-RU"));
        }
    }
}
